from torch import nn

# 定义模型
class FC_Module(nn.Module):
    def __init__(self, p=0.1) -> None:
        # 搭建模型结构
        super(FC_Module, self).__init__() # 继承父类方法
        self.p = p
        self.input_x = nn.Linear(13, 50, bias=False) # 创建输入层，并连接下一个节点为50的隐藏层
        self.fc1 = nn.Linear(50, 50) # 隐藏层2
        self.drop1 = nn.Dropout(self.p) # dropout层
        self.fc2 = nn.Linear(50, 50) # 隐藏层3
        self.drop2 = nn.Dropout(self.p) # dropout层
        self.fc4 = nn.Linear(50, 1) # 隐藏层4
        self.act4 = nn.ReLU()

    def forward(self, inputs):
        # 定义前向模型的数据流
        x = self.input_x(inputs)
        x = self.fc1(x)
        # x = self.act4(x)
        x = self.drop1(x)
        x = self.fc2(x)
        # x = self.act4(x)
        x = self.drop2(x)
        x = self.fc4(x)
        return self.act4(x)